//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.sending;

import java.io.Serializable;
import java.math.BigDecimal;

public class Sending
        implements Serializable {

    public Sending() {
    }

    public Sending(Integer id, String buyId, String palletGTIN, String dateDLUO, BigDecimal inputStockQuantity, BigDecimal stockQuantity, String boxGTIN,
            String itemGTIN, String deliveryForm, Integer agencyId, String supplierGLN, String supplierId, String inputStockDate, String inventoryDate,
            String dateDLC, Integer status, BigDecimal packaging, BigDecimal batchPrice, String notes, String unit, String sscc,
            String truckingCompagny, String updateLastTime, String userId) {
        setId(id);
        setOrderId(buyId);
        setPalletGTIN(palletGTIN);
        setDeliveryDate(dateDLUO);
        setWeight(inputStockQuantity);
        setParcelQuantity(stockQuantity);
        setBoxGTIN(boxGTIN);
        setInsuranceCompany(itemGTIN);
        setDeliveryForm(deliveryForm);
        setAgencyId(agencyId);
        setCustomerGLN(supplierGLN);
        setCustomerId(supplierId);
        setSendingDate(inputStockDate);
        setPreparationDate(inventoryDate);
        setDeliveryAnticipatedDate(dateDLC);
        setStatus(status);
        setPackaging(packaging);
        setInsuranceValue(batchPrice);
        setNotes(notes);
        setUnit(unit);
        setSscc(sscc);
        setTruckingCompagny(truckingCompagny);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
    }

    public Sending(Sending batch) {
        setId(batch.getId());
        setOrderId(batch.getOrderId());
        setPalletGTIN(batch.getPalletGTIN());
        setDeliveryDate(batch.getDeliveryDate());
        setWeight(batch.getWeight());
        setParcelQuantity(batch.getParcelQuantity());
        setBoxGTIN(batch.getBoxGTIN());
        setInsuranceCompany(batch.getInsuranceCompany());
        setDeliveryForm(batch.getDeliveryForm());
        setAgencyId(batch.getAgencyId());
        setCustomerGLN(batch.getCustomerGLN());
        setCustomerId(batch.getCustomerId());
        setSendingDate(batch.getSendingDate());
        setPreparationDate(batch.getPreparationDate());
        setDeliveryAnticipatedDate(batch.getDeliveryAnticipatedDate());
        setStatus(batch.getStatus());
        setPackaging(batch.getPackaging());
        setInsuranceValue(batch.getInsuranceValue());
        setNotes(batch.getNotes());
        setUnit(batch.getUnit());
        setSscc(batch.getSscc());
        setTruckingCompagny(batch.getTruckingCompagny());
        setUpdateLastTime(batch.getUpdateLastTime());
        setUserId(batch.getUserId());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getPalletGTIN() {
        return palletGTIN;
    }

    public void setPalletGTIN(String palletGTIN) {
        this.palletGTIN = palletGTIN;
    }

    public String getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(String deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public BigDecimal getParcelQuantity() {
        return parcelQuantity;
    }

    public void setParcelQuantity(BigDecimal parcelQuantity) {
        this.parcelQuantity = parcelQuantity;
    }

    public String getBoxGTIN() {
        return boxGTIN;
    }

    public void setBoxGTIN(String boxGTIN) {
        this.boxGTIN = boxGTIN;
    }

    public String getInsuranceCompany() {
        return insuranceCompany;
    }

    public void setInsuranceCompany(String insuranceCompany) {
        this.insuranceCompany = insuranceCompany;
    }

    public String getDeliveryForm() {
        return deliveryForm;
    }

    public void setDeliveryForm(String deliveryForm) {
        this.deliveryForm = deliveryForm;
    }

    public String getCustomerGLN() {
        return customerGLN;
    }

    public void setCustomerGLN(String supplierGLN) {
        customerGLN = supplierGLN;
    }

    public Integer getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(Integer agencyId) {
        this.agencyId = agencyId;
    }

    public String getDeliveryAnticipatedDate() {
        return deliveryAnticipatedDate;
    }

    public void setDeliveryAnticipatedDate(String deliveryAnticipatedDate) {
        this.deliveryAnticipatedDate = deliveryAnticipatedDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public BigDecimal getPackaging() {
        return packaging;
    }

    public void setPackaging(BigDecimal packaging) {
        this.packaging = packaging;
    }

    public BigDecimal getInsuranceValue() {
        return insuranceValue;
    }

    public void setInsuranceValue(BigDecimal insuranceValue) {
        this.insuranceValue = insuranceValue;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getSscc() {
        return sscc;
    }

    public void setSscc(String sscc) {
        this.sscc = sscc;
    }

    public String getTruckingCompagny() {
        return truckingCompagny;
    }

    public void setTruckingCompagny(String truckingCompagny) {
        this.truckingCompagny = truckingCompagny;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPreparationDate() {
        return preparationDate;
    }

    public void setPreparationDate(String preparationDate) {
        this.preparationDate = preparationDate;
    }

    public String getSendingDate() {
        return sendingDate;
    }

    public void setSendingDate(String sendingDate) {
        this.sendingDate = sendingDate;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String supplierId) {
        customerId = supplierId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "orderId=" + getOrderId() + " " + "palletGTIN=" + getPalletGTIN() + " " + "deliveryDate=" + getDeliveryDate() + " " + "weight=" + getWeight() + " " + "parcelQuantity=" + getParcelQuantity() + " " + "boxGTIN=" + getBoxGTIN() + " " + "insuranceCompany=" + getInsuranceCompany() + " " + "deliveryForm=" + getDeliveryForm() + " " + "agencyId=" + getAgencyId() + " " + "customerGLN=" + getCustomerGLN() + " " + "customerId=" + getCustomerId() + " " + "sendingDate=" + getSendingDate() + " " + "preparationDate=" + getPreparationDate() + " " + "deliveryAnticipatedDate=" + getDeliveryAnticipatedDate() + " " + "status=" + getStatus() + " " + "packaging=" + getPackaging() + " " + "insuranceValue=" + getInsuranceValue() + " " + "notes=" + getNotes() + " " + "unit=" + getUnit() + " " + "designation=" + getSscc() + " " + "truckingCompagny=" + getTruckingCompagny() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Sending) {
            Sending lTest = (Sending) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (orderId == null) {
                lEquals = lEquals && lTest.orderId == null;
            } else {
                lEquals = lEquals && orderId.equals(lTest.orderId);
            }
            if (palletGTIN == null) {
                lEquals = lEquals && lTest.palletGTIN == null;
            } else {
                lEquals = lEquals && palletGTIN.equals(lTest.palletGTIN);
            }
            if (deliveryDate == null) {
                lEquals = lEquals && lTest.deliveryDate == null;
            } else {
                lEquals = lEquals && deliveryDate.equals(lTest.deliveryDate);
            }
            if (weight == null) {
                lEquals = lEquals && lTest.weight == null;
            } else {
                lEquals = lEquals && weight.equals(lTest.weight);
            }
            if (parcelQuantity == null) {
                lEquals = lEquals && lTest.parcelQuantity == null;
            } else {
                lEquals = lEquals && parcelQuantity.equals(lTest.parcelQuantity);
            }
            if (boxGTIN == null) {
                lEquals = lEquals && lTest.boxGTIN == null;
            } else {
                lEquals = lEquals && boxGTIN.equals(lTest.boxGTIN);
            }
            if (insuranceCompany == null) {
                lEquals = lEquals && lTest.insuranceCompany == null;
            } else {
                lEquals = lEquals && insuranceCompany.equals(lTest.insuranceCompany);
            }
            if (deliveryForm == null) {
                lEquals = lEquals && lTest.deliveryForm == null;
            } else {
                lEquals = lEquals && deliveryForm.equals(lTest.deliveryForm);
            }
            if (agencyId == null) {
                lEquals = lEquals && lTest.agencyId == null;
            } else {
                lEquals = lEquals && agencyId.equals(lTest.agencyId);
            }
            if (customerGLN == null) {
                lEquals = lEquals && lTest.customerGLN == null;
            } else {
                lEquals = lEquals && customerGLN.equals(lTest.customerGLN);
            }
            if (customerId == null) {
                lEquals = lEquals && lTest.customerId == null;
            } else {
                lEquals = lEquals && customerId.equals(lTest.customerId);
            }
            if (deliveryAnticipatedDate == null) {
                lEquals = lEquals && lTest.deliveryAnticipatedDate == null;
            } else {
                lEquals = lEquals && deliveryAnticipatedDate.equals(lTest.deliveryAnticipatedDate);
            }
            if (status == null) {
                lEquals = lEquals && lTest.status == null;
            } else {
                lEquals = lEquals && status.equals(lTest.status);
            }
            if (packaging == null) {
                lEquals = lEquals && lTest.packaging == null;
            } else {
                lEquals = lEquals && packaging.equals(lTest.packaging);
            }
            if (insuranceValue == null) {
                lEquals = lEquals && lTest.insuranceValue == null;
            } else {
                lEquals = lEquals && insuranceValue.equals(lTest.insuranceValue);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (unit == null) {
                lEquals = lEquals && lTest.unit == null;
            } else {
                lEquals = lEquals && unit.equals(lTest.unit);
            }
            if (sscc == null) {
                lEquals = lEquals && lTest.sscc == null;
            } else {
                lEquals = lEquals && sscc.equals(lTest.sscc);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (sendingDate == null) {
                lEquals = lEquals && lTest.sendingDate == null;
            } else {
                lEquals = lEquals && sendingDate.equals(lTest.sendingDate);
            }
            if (preparationDate == null) {
                lEquals = lEquals && lTest.preparationDate == null;
            } else {
                lEquals = lEquals && preparationDate.equals(lTest.preparationDate);
            }
            if (truckingCompagny == null) {
                lEquals = lEquals && lTest.truckingCompagny == null;
            } else {
                lEquals = lEquals && truckingCompagny.equals(lTest.truckingCompagny);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (orderId == null ? 0 : orderId.hashCode());
        result = 37 * result + (palletGTIN == null ? 0 : palletGTIN.hashCode());
        result = 37 * result + (deliveryDate == null ? 0 : deliveryDate.hashCode());
        result = 37 * result + (weight == null ? 0 : weight.hashCode());
        result = 37 * result + (parcelQuantity == null ? 0 : parcelQuantity.hashCode());
        result = 37 * result + (boxGTIN == null ? 0 : boxGTIN.hashCode());
        result = 37 * result + (insuranceCompany == null ? 0 : insuranceCompany.hashCode());
        result = 37 * result + (deliveryForm == null ? 0 : deliveryForm.hashCode());
        result = 37 * result + (agencyId == null ? 0 : agencyId.hashCode());
        result = 37 * result + (customerGLN == null ? 0 : customerGLN.hashCode());
        result = 37 * result + (customerId == null ? 0 : customerId.hashCode());
        result = 37 * result + (deliveryAnticipatedDate == null ? 0 : deliveryAnticipatedDate.hashCode());
        result = 37 * result + (status == null ? 0 : status.hashCode());
        result = 37 * result + (packaging == null ? 0 : packaging.hashCode());
        result = 37 * result + (insuranceValue == null ? 0 : insuranceValue.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (unit == null ? 0 : unit.hashCode());
        result = 37 * result + (sscc == null ? 0 : sscc.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (sendingDate == null ? 0 : sendingDate.hashCode());
        result = 37 * result + (preparationDate == null ? 0 : preparationDate.hashCode());
        result = 37 * result + (truckingCompagny == null ? 0 : truckingCompagny.hashCode());
        return result;
    }
    private Integer id;
    private String orderId;
    private String sscc;
    private String palletGTIN;
    private String boxGTIN;
    private String deliveryForm;
    private String customerGLN;
    private String customerId;
    private Integer agencyId;
    private String sendingDate;
    private String preparationDate;
    private String deliveryAnticipatedDate;
    private String deliveryDate;
    private BigDecimal weight;
    private BigDecimal parcelQuantity;
    private BigDecimal packaging;
    private String unit;
    private BigDecimal insuranceValue;
    private String insuranceCompany;
    private Integer status;
    private String notes;
    private String updateLastTime;
    private String userId;
    private String truckingCompagny;
}
